package com.shopping.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/demo")
public class DemoController {
    @RequestMapping("/demo1")
    public String demo1(){
        return "hello,Demo!";
    }
    @RequestMapping("/demo2")
    public List<String> demo2(){
        List<String> stringList =new ArrayList<>();
        stringList.add("小猫");
        return stringList;
    }

    @RequestMapping("/demo3")
    public Map<String,String> demo3(){
        Map<String,String> map = new HashMap<String,String>(){{
            put("key1","value1");
        }};
        return map;
    }
}
